import request from "@/util/request";

/**
 * 查询当前用户的订单列表（根据订单状态）
 * @param pageInfo
 * @param status
 * @returns {*}
 */
export function getOrderListByStatus(pageInfo,searchDto){
    return request({
        method:'get',
        url:'order/get/orderList',
        params: {
            pageNum:pageInfo.pageNum,
            pageSize:pageInfo.pageSize,
            status:searchDto.status,
            keyWord:searchDto.keyWord
        }
    })
}

export function getOrderItemsByOrderId(orderId){
    return request({
        method:'get',
        url:'order/get/orderList',
    })
}

/**
 * 订单修改
 * @param order
 * @returns {*}
 */
export function  modifyOrder(order){
    return request({
        method:'put',
        url:"order",
        data:order
    })
}

export function getUserEarnings(){
    return request({
        method:'get',
        url:"order/earnings",
    })
}

export function getBusinessOrderItems(searchDto){
    return request({
        method:'get',
        url:"order/orderItem/page",
        params:searchDto
    })
}
